def make_chocolate(small, big, goal):
  if small*1+big*5 >= goal and goal/5 != 0 and goal//5 <= big and goal%5 <= small:
    return goal%5
  else:
    if small == goal:
      return small
    if small*1+big*5 >= goal and goal//5 >= big:
      return goal-big*5
    return -1